<div class="row">
	
	<div>
			<legend>Subjects Set:</legend>
		  <a href="<?php echo site_url('rss-section-schedule/'.$section_id)?>" class="add">Back to View Schedule</a><br><br>
		<?if(!empty($schedules)):?>
		<table class="data-table">
			<thead class="tabular-head">
			<tr>
				<th>ID</th>
				<th>Subject</th>
				<th>Teacher</th>
				<th>Time</th>
				<th>Day</th>
			</tr>
			</thead>
			<tbody class="tabular">

			<?foreach($schedules as $s):?>
				<tr>
					<td><?=$s->subj_uniq_id;?></td>
					<td><?=$s->subj_desc;?></td>
					<td><?=$s->teacher;?></td>
					<td><?=$s->time_from;?> - <?=$s->time_to;?></td>
					<td><?=$s->day;?></td>
					<!-- <td><a href="<?=site_url('room_section_subject/delete_schedule//'.$s->schedule_id.'/'.$section_profile->id);?>" class="confirm data-link" title="Are You Sure You want to delete Schedule?"><i class="fa fa-trash-o"></i>&nbsp; Delete</a>  -->
					<!-- | <a href="<?=site_url('rss-update-schedule/'.$s->schedule_id.'/'.$section_profile->id);?>" class="data-link">Update</a></td> -->
				</tr>
			<?endforeach;?>
			</tbody>
		</table>
		<?else:?>
			<div class="notice">No Subject was assigned for this section</div>
		<?endif;?>
	</div>
	
	<?	if(isset($system_message))echo $system_message;
		echo validation_errors() == '' ? NULL : '<div class="error">'.validation_errors().'</div>';
		$subjects_select = array(''=>'Select Subjects...');
		if(!empty($subjects)):
		
			foreach($subjects as $subject)
			{
				$subjects_select[$subject->subj_id] = '['.$subject->subj_code.'] '.$subject->subj_desc ;
			}
			
		$value_t_s = set_value('t_s');
		$value_t_e = set_value('t_e');
		$value_days = set_value('days');
	?>

		<div>
			<legend>Add New Subject To Schedule</legend>
			<form action="<?=site_url('rss-add-schedule/'.$section_profile->id);?>" method="POST">
				<div class="input-block">
					<label>Select Subject:</label>
					<?=form_dropdown('subject_id', $subjects_select,set_value('subject_id'), 'required');?>
				</div>
				<div class="small-6 columns">
					<div class="small-5 columns">
						<label>Time start</label>
						<input type="text" name="t_s" class="time" style="width:100px;" maxlength="5" value="<?=$value_t_s;?>" required>
					</div>
					<div class="small-5 columns">
						<label>Time End</label>
						<input type="text" name="t_e" class="time" style="width:100px;" maxlength="5" value="<?=$value_t_e;?>" required>
					</div>
				</div>
				<div class="clearfix"></div>
				<div class="input-block">
					<label>Days:</label>
					<input type="text" name="days" value="<?=$value_days;?>" required>
				</div>
				<div class="input-block">
					<label>Teacher In Charge</label>
					<?=form_dropdown('teacher', $teachers,set_value('teacher'), 'required');?>
				</div>
				<div class="input-block" style="clear:both;">
					<input type="hidden" name="section_id" value="<?=$section_id;?>">
					<button type="submit" name="add_schedule" value="Submit" class="btn btn-primary" ><i class="fa fa-upload"></i>&nbsp; Submit</button>
				</div>
			</form>
		</div>
	<?else:?>
		<div class="notice">
			<? $this->session->set_flashdata('grade_level_id',$section_profile->grade_level_id);?>
			No subjects Available <a href="<?=site_url('admin/add_subject');?>" class="add">Add Subjects</a>
		</div>
	
	<? endif;?>
	

	</div>
